Skip to content

🎨 Palette: [UX improvement] 디렉토리 이름 λˆ„λ½ μ‹œ 폴백 제곡 - #371

Closed
seonghobae wants to merge 5 commits into
masterfrom
palette-ux-empty-name-fallback-5514475800644737525
Closed

🎨 Palette: [UX improvement] 디렉토리 이름 λˆ„λ½ μ‹œ 폴백 제곡#371
seonghobae wants to merge 5 commits into
masterfrom
palette-ux-empty-name-fallback-5514475800644737525

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

πŸ’‘ What: 디렉토리 이름(getName)이 λΉ„μ–΄ μžˆμ„ λ•Œ μ ˆλŒ€ 경둜(absolutePath)λ₯Ό 폴백으둜 μ‚¬μš©ν•˜λ„λ‘ μˆ˜μ •ν–ˆμŠ΅λ‹ˆλ‹€.
🎯 Why: 파일 μ‹œμŠ€ν…œ 루트 λ“±μ—μ„œ 이름이 λΉ„μ–΄ 있으면

및 <title> νƒœκ·Έκ°€ λΉ„μ–΄ ν™”λ©΄ νŒλ…κΈ° 및 μ‚¬μš©μžμ—κ²Œ ν˜Όλž€μ„ μ€λ‹ˆλ‹€.
πŸ“Έ Before/After: ν•΄λ‹Ή μ—†μŒ
β™Ώ Accessibility: 빈 제λͺ© μš”μ†Œ λ°©μ§€λ₯Ό 톡해 ν™”λ©΄ νŒλ…κΈ° μ‚¬μš©μžμ—κ²Œ λͺ…ν™•ν•œ μ»¨ν…μŠ€νŠΈ(μœ„μΉ˜)λ₯Ό μ œκ³΅ν•©λ‹ˆλ‹€.


PR created automatically by Jules for task 5514475800644737525 started by @seonghobae

Summary by CodeRabbit

  • μ ‘κ·Όμ„± κ°œμ„ 

    • 디렉터리 이름이 λΉ„μ–΄ μžˆλŠ” 경우 μ ˆλŒ€ 경둜λ₯Ό ν‘œμ‹œ μ΄λ¦„μœΌλ‘œ μ‚¬μš©ν•©λ‹ˆλ‹€.
    • νŽ˜μ΄μ§€ 제λͺ©κ³Ό ν˜„μž¬ μœ„μΉ˜ ν—€λ”μ—μ„œ 루트 디렉터리 및 μ‚¬μš©μž μ§€μ • 마운트 지점을 더 μ‰½κ²Œ 식별할 수 μžˆμŠ΅λ‹ˆλ‹€.
    • 경둜 λ‚΄ 특수 λ¬Έμžκ°€ μ•ˆμ „ν•˜κ²Œ ν‘œμ‹œλ©λ‹ˆλ‹€.
  • ν…ŒμŠ€νŠΈ

    • 빈 디렉터리 이름과 μ ˆλŒ€ 경둜 ν‘œμ‹œλ₯Ό κ²€μ¦ν•˜λŠ” ν…ŒμŠ€νŠΈλ₯Ό μΆ”κ°€ν–ˆμŠ΅λ‹ˆλ‹€.

@google-labs-jules

Copy link
Copy Markdown

πŸ‘‹ Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a πŸ‘€ emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

πŸ“ Walkthrough

Walkthrough

process_dirλŠ” 디렉토리 이름이 λΉ„μ–΄ 있으면 μ ˆλŒ€ 경둜λ₯Ό ν‘œμ‹œ μ΄λ¦„μœΌλ‘œ μ‚¬μš©ν•©λ‹ˆλ‹€. μƒμ„±λœ HTML의 <title>κ³Ό <h1>은 이 값을 HTML μ΄μŠ€μΌ€μ΄ν”„ν•˜μ—¬ ν‘œμ‹œν•©λ‹ˆλ‹€. ν…ŒμŠ€νŠΈλŠ” 파일 생성과 두 HTML μš”μ†Œμ˜ λ‚΄μš©μ„ κ²€μ¦ν•©λ‹ˆλ‹€.

Changes

빈 디렉토리 ν‘œμ‹œ 이름

Layer / File(s) Summary
ν‘œμ‹œ 이름 폴백 및 HTML 좜λ ₯
src/main/kotlin/html4tree/main.kt, src/test/kotlin/html4tree/MainTest.kt, .jules/palette.md
process_dirλŠ” 빈 디렉토리 이름에 absolutePathλ₯Ό μ‚¬μš©ν•©λ‹ˆλ‹€. <title>κ³Ό <h1>은 이 값을 HTML μ΄μŠ€μΌ€μ΄ν”„ν•˜μ—¬ 좜λ ₯ν•©λ‹ˆλ‹€. ν…ŒμŠ€νŠΈλŠ” index.html 생성과 μ ˆλŒ€ 경둜 ν‘œμ‹œλ₯Ό κ²€μ¦ν•©λ‹ˆλ‹€. λ³€κ²½ 기둝도 μΆ”κ°€ν•©λ‹ˆλ‹€.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • ContextualWisdomLab/html4tree#282: λ™μΌν•œ process_dir 폴백과 빈 이름 ν…ŒμŠ€νŠΈλ₯Ό μΆ”κ°€ν•©λ‹ˆλ‹€.
  • ContextualWisdomLab/html4tree#300: 빈 디렉토리 이름에 λŒ€ν•œ λ™μΌν•œ μ ˆλŒ€ 경둜 폴백을 κ΅¬ν˜„ν•©λ‹ˆλ‹€.
  • ContextualWisdomLab/html4tree#321: 빈 디렉토리 이름에 HTML μ΄μŠ€μΌ€μ΄ν”„λœ μ ˆλŒ€ 경둜λ₯Ό μ‚¬μš©ν•©λ‹ˆλ‹€.

Suggested reviewers: copilot

πŸš₯ Pre-merge checks | βœ… 5
βœ… Passed checks (5 passed)
Check name Status Explanation
Description Check βœ… Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check βœ… Passed 제λͺ©μ€ 디렉토리 이름이 없을 λ•Œ 폴백을 μ œκ³΅ν•˜λŠ” μ£Όμš” λ³€κ²½ 사항을 μ •ν™•νžˆ μš”μ•½ν•©λ‹ˆλ‹€.
Docstring Coverage βœ… Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check βœ… Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check βœ… Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
πŸ“ Generate docstrings
  • Create stacked PR
  • Commit on current branch
πŸ§ͺ Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch palette-ux-empty-name-fallback-5514475800644737525

Comment @coderabbitai help to get the list of available commands.

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review
@cwl-noema-review
@opencode-agent

Review the exact live head only. Verify an empty directory getName falls back to a stable absolute-path representation for both h1 and title without exposing an unintended host path beyond the existing local-output contract, preserves HTML escaping and ordinary names, and includes root/empty-name regressions. Require current JVM tests, configured coverage, security gates, and zero unresolved threads. Review only; do not update the branch, merge, release, or alter protections.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Rate Limit Exceeded

@seonghobae have exceeded the limit for the number of chat messages per hour. Please wait 12 minutes and 6 seconds before sending another message.

@google-labs-jules

Copy link
Copy Markdown

@coderabbitai review
@cwl-noema-review
@opencode-agent

Review the exact live head only. Verify an empty directory getName falls back to a stable absolute-path representation for both h1 and title without exposing an unintended host path beyond the existing local-output contract, preserves HTML escaping and ordinary names, and includes root/empty-name regressions. Require current JVM tests, configured coverage, security gates, and zero unresolved threads. Review only; do not update the branch, merge, release, or alter protections.

Acknowledged.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/main/kotlin/html4tree/main.kt (1)

349-354: πŸš€ Performance & Scalability | πŸ”΅ Trivial | ⚑ Quick win

μ΄μŠ€μΌ€μ΄ν”„ κ²°κ³Όλ₯Ό ν•œ 번만 κ³„μ‚°ν•˜μ‹­μ‹œμ˜€.

displayDirName.escapeHtml()κ°€ <title>κ³Ό <h1>μ—μ„œ 각각 μ‹€ν–‰λ©λ‹ˆλ‹€. 빈 μ΄λ¦„μ˜ fallback은 κΈ΄ μ ˆλŒ€ 경둜일 수 μžˆμœΌλ―€λ‘œ 같은 λ¬Έμžμ—΄μ„ 두 번 μˆœνšŒν•©λ‹ˆλ‹€. μ΄μŠ€μΌ€μ΄ν”„ κ²°κ³Όλ₯Ό ν•œ 번 κ³„μ‚°ν•˜κ³  두 μš”μ†Œμ—μ„œ μž¬μ‚¬μš©ν•˜μ‹­μ‹œμ˜€.

μˆ˜μ • μ˜ˆμ‹œ
     val displayDirName = curr_dir.name.ifBlank { curr_dir.absolutePath }
+    val escapedDisplayDirName = displayDirName.escapeHtml()
...
-        <title>${displayDirName.escapeHtml()}</title>
+        <title>${escapedDisplayDirName}</title>
...
-         <h1>${displayDirName.escapeHtml()}</h1>
+         <h1>${escapedDisplayDirName}</h1>

As per coding guidelines, Avoid intermediate string allocations in hot paths; preserve single-pass escaping with lazy StringBuilder usage.

πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/main/kotlin/html4tree/main.kt` around lines 349 - 354, Update the HTML
generation around the <title> and <h1> elements to compute
displayDirName.escapeHtml() once and reuse that escaped value in both places.
Preserve the existing fallback behavior and single-pass escaping, avoiding any
additional repeated traversal or unnecessary intermediate string allocation.

Source: Coding guidelines

πŸ€– Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/test/kotlin/html4tree/MainTest.kt`:
- Around line 151-163: Update testProcessDirWithEmptyName to create the
temporary directory under a path containing HTML-special characters, ensuring
escaping is exercised. Replace expected values that call escapeHtml() with fixed
strings representing the correctly escaped absolute path, and keep asserting
both the title and h1 output.

---

Nitpick comments:
In `@src/main/kotlin/html4tree/main.kt`:
- Around line 349-354: Update the HTML generation around the <title> and <h1>
elements to compute displayDirName.escapeHtml() once and reuse that escaped
value in both places. Preserve the existing fallback behavior and single-pass
escaping, avoiding any additional repeated traversal or unnecessary intermediate
string allocation.
πŸͺ„ Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
βš™οΈ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1631b105-5a38-4fc2-a14e-299ac41f196a

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between f403888 and a4d984b.

πŸ“’ Files selected for processing (3)
  • .jules/palette.md
  • src/main/kotlin/html4tree/main.kt
  • src/test/kotlin/html4tree/MainTest.kt

Comment on lines +151 to +163
@Test
fun testProcessDirWithEmptyName() {
val fakeRoot = object : File(tempDir, "fakeRoot") {
override fun getName() = ""
}
fakeRoot.mkdir()
process_dir(fakeRoot)
val indexFile = File(fakeRoot, "index.html")
assertTrue(indexFile.exists())
val htmlContent = indexFile.readText()
assertTrue(htmlContent.contains("<title>${fakeRoot.absolutePath.escapeHtml()}</title>"))
assertTrue(htmlContent.contains("<h1>${fakeRoot.absolutePath.escapeHtml()}</h1>"))
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ”’ Security & Privacy | 🟑 Minor | ⚑ Quick win

HTML μ΄μŠ€μΌ€μ΄ν”„ 검증을 κ΅¬ν˜„κ³Ό λΆ„λ¦¬ν•˜μ‹­μ‹œμ˜€.

ν˜„μž¬ κΈ°λŒ€κ°’μ΄ fakeRoot.absolutePath.escapeHtml()λ₯Ό λ‹€μ‹œ ν˜ΈμΆœν•©λ‹ˆλ‹€. process_dirκ°€ μ΄μŠ€μΌ€μ΄ν”„λ₯Ό μƒλž΅ν•΄λ„ μž„μ‹œ κ²½λ‘œμ— 특수 λ¬Έμžκ°€ μ—†μœΌλ©΄ ν…ŒμŠ€νŠΈκ°€ 톡과할 수 μžˆμŠ΅λ‹ˆλ‹€. 특수 λ¬Έμžκ°€ ν¬ν•¨λœ 디렉토리 경둜λ₯Ό μ‚¬μš©ν•˜κ³  μ˜ˆμƒ HTML에 κ³ μ •λœ μ΄μŠ€μΌ€μ΄ν”„ κ²°κ³Όλ₯Ό κ²€μ¦ν•˜μ‹­μ‹œμ˜€.

μˆ˜μ • μ˜ˆμ‹œ
-        val fakeRoot = object : File(tempDir, "fakeRoot") {
+        val fakeRoot = object : File(tempDir, "fake&root") {
             override fun getName() = ""
         }
...
-        assertTrue(htmlContent.contains("<title>${fakeRoot.absolutePath.escapeHtml()}</title>"))
-        assertTrue(htmlContent.contains("<h1>${fakeRoot.absolutePath.escapeHtml()}</h1>"))
+        val expectedPath = fakeRoot.absolutePath.replace("&", "&amp;")
+        assertTrue(htmlContent.contains("<title>$expectedPath</title>"))
+        assertTrue(htmlContent.contains("<h1>$expectedPath</h1>"))
πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
@Test
fun testProcessDirWithEmptyName() {
val fakeRoot = object : File(tempDir, "fakeRoot") {
override fun getName() = ""
}
fakeRoot.mkdir()
process_dir(fakeRoot)
val indexFile = File(fakeRoot, "index.html")
assertTrue(indexFile.exists())
val htmlContent = indexFile.readText()
assertTrue(htmlContent.contains("<title>${fakeRoot.absolutePath.escapeHtml()}</title>"))
assertTrue(htmlContent.contains("<h1>${fakeRoot.absolutePath.escapeHtml()}</h1>"))
}
`@Test`
fun testProcessDirWithEmptyName() {
val fakeRoot = object : File(tempDir, "fake&root") {
override fun getName() = ""
}
fakeRoot.mkdir()
process_dir(fakeRoot)
val indexFile = File(fakeRoot, "index.html")
assertTrue(indexFile.exists())
val htmlContent = indexFile.readText()
val expectedPath = fakeRoot.absolutePath.replace("&", "&amp;")
assertTrue(htmlContent.contains("<title>$expectedPath</title>"))
assertTrue(htmlContent.contains("<h1>$expectedPath</h1>"))
}
πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/test/kotlin/html4tree/MainTest.kt` around lines 151 - 163, Update
testProcessDirWithEmptyName to create the temporary directory under a path
containing HTML-special characters, ensuring escaping is exercised. Replace
expected values that call escapeHtml() with fixed strings representing the
correctly escaped absolute path, and keep asserting both the title and h1
output.

Copy link
Copy Markdown
Collaborator Author

Closing as superseded by #395. Both PRs address the same empty root-directory name accessibility gap, but this branch writes File.absolutePath into generated public HTML, disclosing host filesystem layout. #395 uses a deterministic generic / title and heading, preserves the accessibility improvement, and avoids that exposure. Review/check evidence from this branch does not transfer to #395; the newer PR must pass its own current-head gates.

@seonghobae seonghobae closed this Aug 9, 2026
@google-labs-jules

Copy link
Copy Markdown

Closing as superseded by #395. Both PRs address the same empty root-directory name accessibility gap, but this branch writes File.absolutePath into generated public HTML, disclosing host filesystem layout. #395 uses a deterministic generic / title and heading, preserves the accessibility improvement, and avoids that exposure. Review/check evidence from this branch does not transfer to #395; the newer PR must pass its own current-head gates.

Understood. Acknowledging that this work is now obsolete and stopping work on this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant